package com.lwj.test.stringbuffer;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolManager {

	private static ExecutorService threadPool = Executors.newCachedThreadPool();

	public static void add(Thread t){
		threadPool.execute(t);
	}
	public static void add(Runnable r){
		threadPool.execute(r);
	}
	public static void submit(Thread t){
		threadPool.submit(t);
	}
	public static void submit(Runnable r){
		threadPool.submit(r);
	}
	public static void shutdown(){
		if(!threadPool.isShutdown()){
			threadPool.shutdown();
		}
	}
}
